Problem: $f(x) = \begin{cases} 4e^x & \text{for} ~~~~x\gt{0} \\ 4-x& \text{for} ~~~~ x \leq0\end{cases}$ Evaluate the definite integral. $\int^1_{-2}f(x)\,dx = $ Choose 1 answer: Choose 1 answer: (Choice A) A $4e^{-2}+\dfrac72$ (Choice B) B $4e+6$ (Choice C) C $16e+3$ (Choice D) D $16e^{-2}-14$
Answer: Splitting up the definite integral Since we're working with a piecewise function, we need to split the definite integral up into two pieces: $\phantom{=} \int^1_{-2}f(x)\,dx$ $= \int^1_{0}f(x)\,dx + \int^{0}_{-2}f(x)\,dx~~~~~~$ [Why did we split at 0?] $= \int^1_{0}4e^x\,dx + \int^{0}_{-2}(4-x)\,dx ~~~~~~$ Evaluating each piece Next, let's evaluate each of these definite integrals one at a time. The first definite integral: $\begin{aligned} \int^1_{0}4e^x\,dx &=4e^x\Bigg|^1_{{0}} \\\\ &= \left[4e^1 \right] - \left[4e^{0}\right] \\\\ &= \left[4e\right] -\left[4 \right] \\\\ &= {4e-4}\end{aligned}$ The second definite integral: $\begin{aligned} \int^{0}_{-2}(4-x)\,dx &=4x-\dfrac12x^2\Bigg|^0_{{-2}} \\\\ &= \left[4\cdot(0)-\dfrac12\cdot\left({0} \right)^2 \right] - \left[ 4\cdot({-2})-\dfrac12\cdot\left({-2}\right)^2\right] \\\\ &= \left[0\right] -\left[-10 \right] \\\\ &= {10}\end{aligned}$ Putting the pieces together Now let's add these two pieces together to find the answer: $\phantom{=} \int^1_{0}4e^x\,dx + \int^{0}_{-2}(4-x)\,dx$ $ = {4e-4} + {10}$ $ = {4e+6}$ The answer $\int^1_{-2}f(x)\,dx = 4e+6$